﻿<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    <link href="favicon.ico" rel="shortcut icon" >
</head>
<body>


<?php
$conn = mysql_connect("localhost", "root", "");
if (!$conn) {
    die("Could not connect to Server MySQL" . mysql_error());
}else{
    $isSuccess = mysql_query("create database phone_manager", $conn);
    if ($isSuccess) {
        echo "Create database is success";
    }else{
        echo mysql_error()."<br /> ";
    }
    /*$sqlQuery="create table Person(
        name varchar(255) not null,
        phone_number varchar(30),
        address varchar(200),
        sex varchar(10),
        year_old int,
        primary key(phone_number)
    )";*/
    $sqlQuery="insert into person (name,phone_number,address,sex,year_old)
    values ('Ngô Minh Hoàng','0978.241.397','Yên Mỹ Hưng Yên','Male',24)
    ";
    mysql_select_db("phone_manager",$conn);
    $isSuccess = mysql_query($sqlQuery,$conn);
    if ($isSuccess) {
        echo "query: <br /> " . $sqlQuery . " <b>success</b>";
    }else{
        echo "query: <br /> " . $sqlQuery . " <b>faile</b> <br /> Error: " . mysql_error();
    }


}






;?>
<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> 

</body>
</html>